﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hp.Vertica.Client.Internal
{
    public class Schema
    {
        public Schema(String name)
        {
            this.Name = name;
        }

        public Schema(String name, VerticaDatabase db)
            : this(name)
        {
            this.Database = db;
        }
        public String Name { get; set; }

        public VerticaDatabase Database { get; set; }

        public List<Table> Tables
        {
            get { return this.Database.GetTables(this); }
        }

        public List<Category> Categories
        {
            get
            {
                return this.Database.GetCategoriesBySchema(this);
            }
        }

        public String CreateScript
        {
            get
            {
                return "CREATE SCHEMA " + this.Name + ";\n";
            }
        }

        public void AddTable(Table t)
        {
            this.Database.AddTable(t);
        }

    }
}
